package com.ruoyi.finance.mapper;

import com.ruoyi.finance.vo.AssistantCommissionInfo;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.finance.domain.CommissionDeliveryProduct;
import com.ruoyi.finance.domain.CommissionDeliverySituation;
import com.ruoyi.finance.domain.CommissionSalesData;

import java.util.Date;
import java.util.List;

/**
 * 销售出(退)库单Mapper接口
 *
 * @author admin
 * @date 2023-10-13
 */
public interface CommissionDeliveryProductMapper {
    /**
     * 查询销售出(退)库单
     *
     * @param id 销售出(退)库单ID
     * @return 销售出(退)库单
     */
    public CommissionDeliveryProduct selectCommissionDeliveryProductById(Long id);

    /**
     * 查询销售出(退)库单列表
     *
     * @param commissionDeliveryProduct 销售出(退)库单
     * @return 销售出(退)库单集合
     */
    public List<CommissionDeliveryProduct> selectCommissionDeliveryProductList(CommissionDeliveryProduct commissionDeliveryProduct);

    /**
     * 新增销售出(退)库单
     *
     * @param commissionDeliveryProduct 销售出(退)库单
     * @return 结果
     */
    public int insertCommissionDeliveryProduct(CommissionDeliveryProduct commissionDeliveryProduct);

    /**
     * 修改销售出(退)库单
     *
     * @param commissionDeliveryProduct 销售出(退)库单
     * @return 结果
     */
    public int updateCommissionDeliveryProduct(CommissionDeliveryProduct commissionDeliveryProduct);

    /**
     * 批量修改销售出(退)库单
     *
     * @param commissionDeliveryProductList
     * @return 结果
     */
    public int batchUpdateCommissionDeliveryProduct(List<CommissionDeliveryProduct> commissionDeliveryProductList);

    /**
     * 删除销售出(退)库单
     *
     * @param id 销售出(退)库单ID
     * @return 结果
     */
    public int deleteCommissionDeliveryProductById(Long id);

    /**
     * 批量删除销售出(退)库单
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteCommissionDeliveryProductByIds(Long[] ids);

    List<CommissionDeliverySituation> selectCommissionDeliverySituationByPiNos(@Param("array") List<String> piNos,@Param("date") Date date);

    List<CommissionSalesData> getCommissionDataByDate(Date date);

    List<CommissionSalesData> getShopCommissionDataByDate(Date date);

    List<String> getSalesNameByType(@Param("list") List<String> piNoList, @Param("deptList") List<String> salesDeptList);

    List<AssistantCommissionInfo> getAssistantCommissionInfo(List<String> piNoList);
}
